GraphLinksModelLinkData

StockSharp.Xaml.Diagram.GXDiagram.Model

A simple representation of link data that supports property change notification, copying, and undo via the INotifyPropertyChanged, ICloneable, and IChangeDataValue interfaces.

实现: INotifyPropertyChanged, IChangeDataValue, ICloneable

构造函数

GraphLinksModelLinkData()

The default constructor produces an empty object with no references to nodes.

GraphLinksModelLinkData(T, T, T, T)

This constructor initializes the From and To properties.

from
a node key identifying the node data from which the link comes
fromport
an optional value identifying which port on the "from" node the link is connected to
to
a node key identify the node data to which the link goes
toport
an optional value identifying which port on the "to" node the link is connected to
GraphLinksModelLinkData(T, T)

This constructor initializes the From and To properties.

from
to

属性

Category : string

Gets or sets a String that names the category to which the link data belongs.

From : T

Gets or sets the key value of the node from which this link comes.

FromPort : T

Gets or sets the optional parameter information for the From node's port.

LabelNode : T

Gets or sets the key value of the node which is on this link acting as if it were a label.

Points : IEnumerable<Point>

Gets or sets a collection of Points used to define the path of the link.

Text : string

Gets or sets a string that can be used for a text label on a link.

To : T

Gets or sets the key value of the node to which this link goes.

ToPort : T

Gets or sets the optional parameter information for the To node's port.

方法

ChangeDataValue(ModelChangedEventArgs, bool)

This method implements the IChangeDataValue interface, used to perform state changes for undo and redo.

e
an edit describing the change to be performed
undo
true if undoing; false if redoing
Clone() : object

Create a copy of this data; this implements the ICloneable interface.

ConvertNodeKeyToString(T) : string

Convert a key value to a string.

key

返回值: a String from which String) can recover the original key value

ConvertPortKeyToString(T) : string

Convert a key value to a string.

key

返回值: a String from which String) can recover the original key value

ConvertStringToNodeKey(string) : T

Convert a string to a key value.

s

返回值: a

ConvertStringToPortKey(string) : T

Convert a string to a key value.

s

返回值: a

LoadFromXElement(XElement)

Initialize this link data with data held in a Linq for XML XElement.

e
the XElement
MakeXElement(XName) : XElement

Constructs a Linq for XML XElement holding the data of this link.

n
the name of the new XElement

返回值: an initialized XElement

OnPropertyChanged(ModelChangedEventArgs)

Raise the PropertyChanged event.

e
RaisePropertyChanged(string, object, object)

Call this method from property setters to raise the PropertyChanged event.

pname
the property name
oldval
the value before the property was set
newval
the new value
ToString() : string

For debugging, use the From and To properties as this object's default text rendering.

返回值: a String like "Node1 --> Node2"

事件

PropertyChanged : PropertyChangedEventHandler

This event implements the INotifyPropertyChanged interface, so that both the model and the dependency object system can be informed of changes to property values.